716A Crazy Computer codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,c,ans=1,i;
cin>>n>>c;
int a[n];
for(i=0;i<n;i++) cin>>a[i];
for(i=n-1;i>=1;i--)
{
if(a[i]-a[i-1]>c) break;
ans++;
}
cout<<ans<<endl;
return 0;
}
0 Comments